<?php 

class Redis_CONST
{	
	
	/*****************************
				参数
	*****************************/
	const SUCCESS 						= 0;		//操作成功
	const FAILED  						= -1;		//操作失败
	const Key_Nonexistent				= -1;
	const Key_Exists					= true;
	const Member_Nonexistent			= false;
	const Member_Exists					= true;
	const DATA_NONEXISTENT 				= false;		//数据不存在

	/*
		Logs
	*/
	const GameResult_Key 				= "GR:[dealernum]:[gametype]";
	const GameScore_Key 				= "GS:[dealernum]:[gametype]";
	
	/*
		Room
		hash
	*/
	const Room_Key						= "Room:[roomid]";		
	const Room_Field_Number				= "number";				//房间号
	const Room_Field_GameRound			= "ground";				//当前轮数
	const Room_Field_GameNum			= "gnum";				//当前局数
	const Room_Field_Status				= "stat";				//房间状态，1等待、2进行中、3关闭
	const Room_Field_Scoreboard			= "scoreboard";			//每局积分榜
	const Room_Field_Banker				= "banker";		//庄家 account_id
	const Room_Field_Creator			= "creator";		//房间创建者 account_id


	const Room_Field_Joker				= "joker";		//鬼牌设置  0无鬼牌  1翻牌  2红中
	const Room_Field_7Dui				= "7dui";		//七对倍数
	const Room_Field_Q1S				= "q1s";		//清一色倍数
	const Room_Field_13Y				= "13y";		//13幺倍数
	const Room_Field_Horse				= "horse";		//买马数目

	const Room_Field_QiangGang		= "qianggang";		//抢杠胡
	const Room_Field_ChengBao		= "chengbao";		//承包杠爆
	const Room_Field_TicketCount	= "ticketcnt";		//每轮消耗房卡数量
	const Room_Field_TotalNum		= "totalnum";		//每轮总局数

	const Room_Field_BaseScore		= "baseScr";		//基础分

	const Room_Field_StartTime		= "startTime";		//开局时间
    const Room_Field_NewNumber				= "newRoomNumber";				//房间号.
    const Room_New_Key                  = "RoomNumber";

	/*
		Room Geo
		用户地理位置
		hash
	*/
	const Geo_Key				= "Geo:[roomid]";
	const Geo_Field_User			= "[accountid]";
	
	
	/*
		Room User Score
		总积分
		hash
	*/
	const RoomScore_Key					= "RoomScore:[roomid]";
	const RoomScore_Field_User			= "[accountid]";
	
	
	/*
		Room Account User Status
		用户状态
		hash
	*/
	const AccountStatus_Key				= "AccStatus:[roomid]";
	
	const AccountStatus_Field_User			= "[accountid]";


	/*
		用户是否扣了房卡  hash
	*/
	const TicketChecked_Key				= "TicketChecked:[roomid]";

	
	/*
		Room Join Sequence  
		
		有序集合
			score	:	timestamp
			value	:	account_id
	*/
	const RoomSequence_Key				= "RoomSeq:[roomid]";

	/*
		当局分数输赢
		hash
	*/
	const Chip_Key					= "Chip:[roomid]";

	/*
		当前游戏局参数
		hash
	*/
	const Play_Key					= "Play:[roomid]";		

	const Play_Field_LastUser		= "lastuser";		//上次出牌人id account_id
	const Play_Field_LastCard       = "lastdiscard";    //上次出牌
	const Play_Field_InDanger      = "indanger";		//上次出牌人是否处于承包风险中

	const Play_Field_NewCard		= "newcard";		//当前出牌人新摸到的牌


	const Play_Field_ActiveUser			= "actUser";			//当前操作用户，默认-1
	const Play_Field_ActiveType			= "actType";			//当前操作, 1打牌  2碰  3杠
	const Play_Field_TimerId			= "timerId";			//当前计时器ID，默认-1
	const Play_Field_TimerTime			= "timerTime";			//自动开局计时器设置时间，默认-1表示没有倒计时

	const Play_Field_QiangGang			= "qianggang";			//是否有人抢杠

	const Play_Field_JokerCard			= "jokercard";			//鬼牌
	
	const Play_Field_Multiple		= "multiple";			//当前倍数

	
	/*
		游戏局玩家队列  
	*/
	const PlayMember_Key				= "PlayMem:[roomid]";

	const PlayerCard_Key				= "PlayerCard:[seatnum]:[roomid]";
	const PengCard_Key				= "PengCard:[seatnum]:[roomid]";
	const AnGang_Key				= "AnGang:[seatnum]:[roomid]";
	const MingGang_Key				= "MingGang:[seatnum]:[roomid]";
	const Discard_Key					= "Discard:[seatnum]:[roomid]";


	const RemainCard_Key				= "RemainCard:[roomid]";

	const DaiQiangGang_Key            = "DaiQiangGang:[roomid]";  //抢杠者 集合
	const YiQiangGang_Key             = "YiQiangGang:[roomid]";  //已抢杠者 集合
	
}


/* End of file constants.php */
/* Location: ./application/config/constants.php */
